
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.BLL%>

<%template _Header%>

<script type="text/javascript">
var query = location.href.substring(location.href.indexOf("?")); 
function loadLogCommentList()
{
  
  var aurl = "/Pages/alpha/Ajax/LogCommentListAjax.aspx"+query+"&page=1";
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      $("LogCommentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
}  

function ViewLogCommentPage(pageindex)
{
  
  var aurl = "/Pages/alpha/Ajax/LogCommentListAjax.aspx"+query+"&page="+pageindex;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      $("LogCommentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 


 
function LogCommentDelete(logCommentId)
{
  
  var aurl = "/Pages/alpha/Ajax/LogCommentDeleteAjax.aspx"+query+"&logCommentId="+logCommentId;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      $("LogCommentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 


function LogCommentAdd(logId)
{
  
    var comment = $("comment").value;
    if (comment.length == 0)
    {
        alert("评论内容不能为空！");
        return;
    }
    if(comment.length > 300 ) 
    {
        alert("评论内容不能超过300个字！");
        return;
    }
  
  $("comment_submit").disabled = true;
  var aurl = "/Pages/alpha/Ajax/LogCommentAddAjax.aspx"+"?lid="+logId+"&comment="+comment.escUrl();
  var myAjax=new Ajax(aurl,
  {
     method:'post',
     onComplete:function()
     {
          var html=this.response.text;
          $("LogCommentList").innerHTML=html;
          $("comment").value="";
          $("comment_submit").disabled = false;
      }
   }
   );
   myAjax.request();
  
  
}

function LogCommentReplyAdd(logId,logCommentId)
{

    var replycontent = $("replycontent_"+logCommentId).value;
    if (replycontent.length == 0)
    {
        alert("回复内容不能为空！");
        return;
    }
    if(replycontent.length > 300 ) 
    {
        alert("回复内容不能超过300个字！");
        return;
    }
  
  $("reply_submit_"+logCommentId).disabled = true;
  var aurl = "/Pages/alpha/Ajax/LogCommentAddAjax.aspx"+"?lid="+logId+"&parentId="+logCommentId+"&reply="+replycontent.escUrl();
  var myAjax=new Ajax(aurl,
  {
     method:'post',
     onComplete:function()
     {
          var html=this.response.text;
          $("LogCommentList").innerHTML=html;
          $("replycontent_"+logCommentId).value="";
          $("reply_submit_"+logCommentId).disabled = false;
          $("replybox_"+logCommentId).style.display = "none";
      }
   }
   );
   myAjax.request();
  
  
}

function replyLogComment(logCommentId)
{
    var e1 = document.getElementById('replybox_'+logCommentId); 
    var e2 = document.getElementById('replycontent_'+logCommentId); 
    e1.style.display = 'block';
    e2.focus();

 }
function replyCancell(logCommentId)
{
    var e1 = document.getElementById('replybox_'+logCommentId); 
    var e2 = document.getElementById('replycontent_'+logCommentId); 
    e1.style.display = 'none';
    e2.value = "";
}

loadLogCommentList();

</script>

<div class="layout2-cols2">
<%template _memmenu%>
	<div class="pannelcontent">

		<div class="pcontent">
		<div class="panneldetail">
			<div class="panneltabs">
                 <%template _logmenu%>
	
				</div>	
          <div class="pannelbody">
			
		<div class="news">
				    <div class="logtitle">
                    <span>{logTopicData.Title}</span>&nbsp;
                     <%csharp%> TempUrl = logTopicData.PostTime.ToString("yyyy-MM-dd hh:mm:ss"); <%/csharp%>
				      ({TempUrl}) &nbsp;
				      
                        <%if UserData.Id==logTopicData.HostUserId%>
                        <%csharp%> TempUrl = "/User/LogEdit.aspx?lid=" +logTopicData.Id;<%/csharp%>			
                        <a href="{this.GetUrl(TempUrl)}">编辑</a>&nbsp;&nbsp;
                        <%csharp%> TempUrl = "/User/LogDel.aspx?lid=" +logTopicData.Id;<%/csharp%>
                        <a href="#" onclick="if(window.confirm('删除日志将同时删除该日志全部评论，确定删除？')) window.location.href='{this.GetUrl(TempUrl)}';">删除</a>
                        <%/if%>	 
				    </div>
				    <div>
				        {logTopicData.Body}
				        <%csharp%>if(tagArrSplit != null) { <%/csharp%>
			                <div class="tags">
			                <font color=black>搜索更多的相关文章:</font>&nbsp
			                <%csharp%>for(int i=0; i<tagArrSplit.Length; i++){
			                 TempUrl = "/Tag.aspx?tagname="+tagArrSplit[i];    
			                <%/csharp%>
			                <a href="{this.GetUrl(TempUrl)}" ><font color="red">{tagArrSplit[i]}</font></a>&nbsp
			                <%csharp%>}<%/csharp%>
			                </div>
			            <%csharp%>}<%/csharp%>
				    </div>
				</div>

		
	
	    <div class="box">
	    <div class="pl">

		    <div name="fedbk" id="LogCommentList">
		    <div style="padding:20px 50px;">
		     <%csharp%> TempUrl = "/images/indicator_medium.gif";<%/csharp%>
		        <img src="{this.GetResource(TempUrl)}" /><b>正在加载评论……</b>
             
             </div>
		    </div>
	    </div>     
	    </div>
<style>
.hugbook a
{
	text-decoration:underline!important;
}

</style>
	    <div class="box">
	        <div class="caption">
	            发表评论：
	        </div>
	        <div class="content">

	                <div id="plshow">
	                    <div class="bor"> 
                            <textarea name="comment" rows="6" cols="100" id="comment"></textarea>
                        </div>
                        &nbsp;&nbsp;请文明参与讨论，禁止漫骂攻击。
                        <input name="sb" id="comment_submit" type="button" value="马上发表" onclick="LogCommentAdd({logTopicData.Id});"/>
                    </div>

            </div>
	    </div>
	           
</div>
</div>
</div>
</div>
	
</div>

<%template _footer%>		
